/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaFecharConta.java
 *
 * Created on 17/06/2010, 20:46:41
 */

package br.com.pi.SmartFast.view;

import br.com.pi.SmartFast.controler.ControleFecharCaixa;

/**
 *
 * @author Lídia
 */
public class TelaFecharConta extends javax.swing.JFrame {

    ControleFecharCaixa control ;
    TelaCliente tc = new TelaCliente();


    /** Creates new form TelaFecharConta */
    public TelaFecharConta() {
        initComponents();
        control = new ControleFecharCaixa(jt_tabela, jl_total,this);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bt_sobremesa = new javax.swing.JButton();
        bt_refeicao = new javax.swing.JButton();
        bt_bebida = new javax.swing.JButton();
        jl_total = new javax.swing.JLabel();
        jb_fechar_conta = new javax.swing.JButton();
        jb_reabrir_conta = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_tabela = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Tela Fechar Conta");
        setMinimumSize(new java.awt.Dimension(1024, 768));
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        bt_sobremesa.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgSobremesas.png"))); // NOI18N

        bt_refeicao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgRefeicoes.png"))); // NOI18N

        bt_bebida.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgBebidas.png"))); // NOI18N

        jl_total.setFont(new java.awt.Font("Tahoma", 1, 24));
        jl_total.setText("TOTAL = R$");

        jb_fechar_conta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgFecharConta3.png"))); // NOI18N
        jb_fechar_conta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_fechar_contaActionPerformed(evt);
            }
        });

        jb_reabrir_conta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgReabrirConta.png"))); // NOI18N
        jb_reabrir_conta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_reabrir_contaActionPerformed(evt);
            }
        });

        jt_tabela.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "PRODUTOS", "QTD", "VALOR"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jt_tabela.setMaximumSize(new java.awt.Dimension(225, 0));
        jt_tabela.setMinimumSize(new java.awt.Dimension(225, 0));
        jScrollPane1.setViewportView(jt_tabela);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jb_fechar_conta, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(jb_reabrir_conta, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                        .addGap(398, 398, 398))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bt_bebida, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 253, Short.MAX_VALUE)
                        .addComponent(bt_refeicao, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(198, 198, 198)
                        .addComponent(bt_sobremesa)
                        .addGap(45, 45, 45))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1173, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jl_total, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
                        .addGap(842, 842, 842))))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {bt_bebida, bt_refeicao, bt_sobremesa});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(bt_bebida)
                        .addComponent(bt_sobremesa, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addComponent(bt_refeicao))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(56, 56, 56)
                        .addComponent(jl_total)
                        .addGap(18, 18, 18)
                        .addComponent(jb_fechar_conta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jb_reabrir_conta)))
                .addGap(28, 28, 28))
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jb_fechar_conta, jb_reabrir_conta});

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jb_fechar_contaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_fechar_contaActionPerformed

        control.botaoFecharPedidoAoclicar();
        
}//GEN-LAST:event_jb_fechar_contaActionPerformed

    private void jb_reabrir_contaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_reabrir_contaActionPerformed

        control.botaoAbrirConta();
}//GEN-LAST:event_jb_reabrir_contaActionPerformed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

        control.telaAoAbrir();


    }//GEN-LAST:event_formWindowOpened

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new TelaFecharConta().setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bt_bebida;
    private javax.swing.JButton bt_refeicao;
    private javax.swing.JButton bt_sobremesa;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jb_fechar_conta;
    private javax.swing.JButton jb_reabrir_conta;
    private javax.swing.JLabel jl_total;
    private javax.swing.JTable jt_tabela;
    // End of variables declaration//GEN-END:variables

}
